UserRepository

@Singleton
class UserRepository @Inject constructor(accountService: AccountService, firestore: FirebaseFirestore, firebaseAuth: FirebaseAuth)

Repository class that manages user-related operations such as authentication state changes, retrieving user data (like email and display name) from Firestore, and interacting with the FirebaseAuth service.

Constructors

Link copied to clipboard
@Inject
constructor(accountService: AccountService, firestore: FirebaseFirestore, firebaseAuth: FirebaseAuth)

Functions

Link copied to clipboard
fun getAuthState(): Flow<AuthState>

Exposes a Flow that emits the current authentication state of the user, such as whether the user is authenticated or unauthenticated.

Link copied to clipboard
suspend fun getDisplayName(): String

Retrieves the user's display name from Firestore. The display name is fetched from the user's document.

Link copied to clipboard
suspend fun getUserEmail(): String

Retrieves the user's email from Firestore. The email is fetched from the user's document.